package com.naiterui.ehp.bp.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.Data;

/**
 * 随访任务
 * 
 * @author yangfuya
 * @since 2022/1/5
 */
@Data
@Entity
@Table(name = "dr_follow_up_record")
public class DrFollowUpRecord implements Serializable {
    /**
     * 复诊计划状态 1：待复诊  2：已报道 3：已取消 4：已过期，随访问卷状态 1：待执行 2：已执行 3：已取消
     */
    public static final int NOT_STARTED = 1;
    public static final int STARTED = 2;
    public static final int CANCEL = 3;
    public static final int EXPIRED = 4;

    /**
     * 随访类型 1：复诊计划 2：随访问卷
     */
    public static final int TYPE_SUBSEQUENT = 1;
    public static final int TYPE_QA = 2;

    /**
     * 复诊或者问卷是否都已报道或者已经填写0否1是
     */
    public static final int COM_STATUS_YES = 1;
    public static final int COM_STATUS_NO = 0;

    /**
     * 复诊是线上还是线下 1线上  2线下
     */
    public static final int ONLINE_TYPE_UP = 1;
    public static final int ONLINE_TYPE_DOWN = 2;

    private static final long serialVersionUID = 7696502839940800685L;
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    /**
     * 随访名称
     */
    @Column(name = "name")
    private String name;

    /**
     * 医生id
     */
    @Column(name = "doctor_id")
    private Long doctorId;

    /**
     * 患者id
     */
    @Column(name = "patient_id")
    private Long patientId;

    /**
     * 就诊人id
     */
    @Column(name = "inquirer_id")
    private Long inquirerId;

    /**
     * 就诊人名称（快照信息）
     */
    @Column(name = "inquirer_name")
    private String inquirerName;

    /**
     * 就诊人性别（快照信息）
     */
    @Column(name = "inquirer_gender")
    private String inquirerGender;

    /**
     * 就诊人年龄（快照信息）
     */
    @Column(name = "inquirer_age")
    private String inquirerAge;

    /**
     * 开始时间
     */
    @Column(name = "begin_time")
    private Date beginTime;

    /**
     * 结束时间
     */
    @Column(name = "end_time")
    private Date endTime;

    /**
     * 复诊计划状态 1：待复诊  2：已报道 3：已取消 4：已过期，随访问卷状态 1：待执行 2：已执行 3：已取消
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 计划类型：1=复诊，2=问卷
     */
    @Column(name = "type")
    private Integer type;

    /**
     * 复诊或者问卷是否都已报道或者已经填写0否1是
     */
    @Column(name = "complete_status")
    private Integer completeStatus;

    /**
     * 完成填写或报道时间
     */
    @Column(name = "complete_time")
    private Date completeTime;

    /**
     * 复诊是线上还是线下 1线上  2线下
     */
    @Column(name = "online_type")
    private Integer onlineType;

    /**
     * 复诊线上问诊是视频还是图文  1图文 2视频
     */
    @Column(name = "consult_type")
    private Integer consultType;
    /**
     * 视频问诊房间号
     */
    @Column(name = "room_id")
    private String roomId;

    /**
     * 视频问诊id
     */
    @Column(name = "video_consult_id")
    private Long videoConsultId;

    /**
     * 执行医嘱
     */
    @Column(name = "medical_advice")
    private String medicalAdvice;
    /**
     * 原因
     */
    @Column(name = "reason")
    private String reason;
    /**
     * 复诊记录
     */
    @Column(name = "visit_record")
    private String visitRecord;
    /**
     * 随访计划编号
     */
    @Column(name = "follow_no")
    private String followNo;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    @Version
    @Column(name = "version")
    private Integer version;
}
